import { Routes, Route, Navigate } from "react-router-dom";
// 引入路由懒加载
import { Suspense, lazy } from "react";
// 引入rem
import "./assets/js/rem";
//引入重置样式
import "./assets/css/reset.css";
// 引入矢量图标
import "./assets/font/iconfont.css";

const Index = lazy(() => import('./pages/index'))
const Order = lazy(() => import('./pages/order'))
const Login = lazy(() => import('./pages/Login'))
const Register = lazy(() => import('./pages/Register'))
const Coupon = lazy(() => import('./pages/coupon'))
const Detail=lazy(()=>import('./pages/Detail.jsx'))
const Catelist = lazy(() => import("./pages/catelist"));
function App() {
  return (
    <div>
      <Suspense>
        <Routes>
          <Route path="/index/*" element={<Index />}></Route>
          <Route path="/order" element={<Order />}></Route>
          <Route path="/login" element={<Login />}></Route>
          <Route path="/register" element={<Register />}></Route>
          <Route path="/cou" element={<Coupon />}></Route>
          <Route path="/detail" element={<Detail />}></Route>
          <Route path="/catelist" element={<Catelist />}></Route>
          {/* 路由重定向 */}
          <Route path="*" element={<Navigate to="/index"></Navigate>}></Route>
        </Routes>
      </Suspense>

    </div>
  );
}

export default App;
